#!/bin/bash

echo "============================================"
echo "合并codegen开头的zip包中的SQL文件"
echo "============================================"
echo

# 检查Python是否安装
if ! command -v python3 &> /dev/null; then
    if ! command -v python &> /dev/null; then
        echo "错误: 未找到Python，请先安装Python 3.x"
        echo "Ubuntu/Debian: sudo apt-get install python3"
        echo "CentOS/RHEL: sudo yum install python3"
        echo "macOS: brew install python3"
        exit 1
    else
        PYTHON_CMD="python"
    fi
else
    PYTHON_CMD="python3"
fi

echo "使用Python命令: $PYTHON_CMD"
echo "正在运行Python脚本..."
echo

$PYTHON_CMD merge_sql_files.py

echo
echo "脚本执行完成！"
